IF  EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].GetDeliverableStatusesForFinanceMaster') AND type in (N'P', N'PC'))
DROP PROCEDURE [dbo].GetDeliverableStatusesForFinanceMaster 
GO
-- =======================================================================
-- =======================================================================  
-- Procedure Name: dbo.GetDeliverableStatusesForFinanceMaster  
--  
-- Author:      Ponraja Chandran
--  
-- Create date: 11/18/09  
--  
-- Description: Returns list of Deliverable Statuses for Finance Reports  
--  
-- Parameters:  None  
--                
-- Returns:     INT, 0=Success, -1=Error  
--  
-- SampleCall:  
-- EXECUTE dbo.GetDeliverableStatusesForFinanceMaster()  
--  
--------------------------------------------------------------------------  
-- Date        Initials  Modification  
--------------------------------------------------------------------------  
-- 03/12/09    RM   Created based on the GetDeliverableStatusesForFinance stored  
--  
-- =======================================================================  
  
CREATE PROCEDURE [dbo].GetDeliverableStatusesForFinanceMaster  
AS  
BEGIN  
     /*  Returned Fields for Dropdown  
     --------------------------------  
     DELSTAT             VARCHAR               
     DELSTATID           VARCHAR  
     */  
  
     -- Initial Settings  
     SET NOCOUNT ON  
       
     -- Declare Local Variables  
     DECLARE   @Error            INT,  
               @RowCount         INT  
  
     -- Result Query      
     SELECT 'ALL'   AS DELSTAT,  
               0    AS DELSTATID,  
            'All' AS DELSTATDESC  
     UNION  
     SELECT 'FSRAssigned',  
               1,  
            'FSR Report Assigned'  
     UNION
     SELECT 'FSRDue',  
               2,  
            'FSR Report Due'  
     UNION  
     SELECT 'FSROutToDept',  
               3,  
            'FSR Report Out to Dept'  
     UNION  
     SELECT 'Other',  
               4,  
            'Other'  
     UNION  
     SELECT 'Pending',  
               5,  
            'Pending'       
     ORDER BY DELSTATID                
  
     SELECT @Error=@@ERROR,@RowCount=@@ROWCOUNT  
     IF @Error!=0  
          RETURN -1  
  
     -- Return Success  
     RETURN 0       
END  
GO

GRANT EXECUTE ON dbo.GetDeliverableStatusesForFinanceMaster TO InsightReport,Insight
GO
